package com.espirit.eap.manager.workflow;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.espirit.eap.sa.LoginUser;
import com.googlecode.cswish.model.Saas;

@Entity
public class WFInstanceTracker implements Serializable , Saas{
	private static final long serialVersionUID = -5549724079426405553L;
	
	private Integer id;
	private LoginUser user;
	private Date createdOn;
	private Date modifyOn;
	private WFInstance parent;
	private WFStatus status;
	private String remark;
	
	private Integer sid;
	public Integer getSid() {
		return sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}
	
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@ManyToOne(targetEntity=LoginUser.class,fetch=FetchType.LAZY)
	public LoginUser getUser() {
		return user;
	}
	public void setUser(LoginUser user) {
		this.user = user;
	}
	public Date getCreatedOn() {
		return createdOn;
	}
	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	@ManyToOne(targetEntity=WFInstance.class,fetch=FetchType.LAZY)
	public WFInstance getParent() {
		return parent;
	}
	public void setParent(WFInstance parent) {
		this.parent = parent;
	}
	
	@ManyToOne(targetEntity=WFStatus.class,fetch=FetchType.LAZY)
	public WFStatus getStatus() {
		return status;
	}
	public void setStatus(WFStatus status) {
		this.status = status;
	}
	public Date getModifyOn() {
		return modifyOn;
	}
	public void setModifyOn(Date modifyOn) {
		this.modifyOn = modifyOn;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
}
